export function isFunction(func: any): func is (...args: any[]) => any {
    return typeof func === 'function';
}

function isType(value: any, type: string): boolean {
    return toString.call(value) === '[object ' + type + ']';
}

export function isBoolean(value: any): value is boolean {
    return isType(value, 'Boolean');
}

export function isObject<T = object>(value: any): value is T {
    /**
     * isObject({}) => true
     * isObject([1, 2, 3]) => true
     * isObject(Function) => true
     * isObject(null) => false
     */
    var type = typeof value;
    return (value !== null && type === 'object') || type === 'function';
}